package com.example.config;

import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class) //所有异常
//@ExceptionHandler(RuntimeException.class) //运行时的异常
//    @ExceptionHandler(MethodArgumentNotValidException.class) //最大上传文件
    public String myerror(){
        return "myerror";
    }
}
